package com.mike.layoutdemo415lbx;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

public class LinearActivity extends AppCompatActivity implements View.OnClickListener{
   private TextView tvId ;
   private TextView tvSchool;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_linear);
        tvId = findViewById(R.id.tvId);
        tvSchool = findViewById(R.id.tvschool);
        tvId.setOnClickListener(this);
        tvSchool.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if(id == R.id.tvId){
            Toast.makeText(this,tvId.getText().toString(), Toast.LENGTH_SHORT).show();
        }
        if(id == R.id.tvschool){
            Toast.makeText(this,tvSchool.getText().toString() , Toast.LENGTH_SHORT).show();
        }
    }
}